
<!-- [Left menu] start -->
<div class="leftmenu">

	<h1 id="pageinfo">Quick Launch</h1>
	
	<ul id="tabs" class="quickmenu">
		<li><a href="<?=site_url('part/create')?>">New Part</a></li>
		<li><a href="<?=site_url('part/index')?>">Import</a></li>
	</ul>
	<div class="quickend">
	</div>

</div>
<!-- [Left menu] end -->

<!-- [Content] start -->
<div class="content slim">

<script type="text/javascript">
function change_parent() {
	selected = document.getElementById('parent').selectedIndex;
	document.getElementById('pre_uri').innerHTML = '/'+document.getElementById('parent').options[selected].value;
}
</script>

<h1 id="edit">Parts</h1>
	
<form class="edit" action="<?=site_url('part/index')?>" method="post" accept-charset="utf-8">
 	

	
		<br class="clearfloat" />

		<hr />

		<?php if ($notice = $this->session->flashdata('notification')):?>
		<p class="notice"><?=$notice;?></p>
		<?php endif;?>


	<div class="row">
	<table>
		<tr>
			<td>
			
			<table>
				<tr>
				<td><span><label for="search_part_number"><?php echo $this->lang->line('search_partnumber');?>:</label>
					<input id="search_part_number" type="text" name="search_part_number" value="" maxlength="100" size="20" />
					</span></td>
				<td><span><label for="search_part_type_id"><?php echo $this->lang->line('search_parttype');?>:</label>
					<select name="search_part_type_id" id="search_part_type_id">
        					<option value=""><?php echo $this->lang->line('part_all_types');?></option>
		<?php foreach($typeList->result() as $type) {
			 if ($type->id == $row->part_type) {
				 echo '<option value="'.$type->id.'" selected="selected">'.$type->name.'</option>';
			 } else {
				 echo '<option value="'.$type->id.'">'.$type->name.'</option>';
			 }
		}
		?>
									</select></span></td>
				<td><span><label for="search_part_description"><?php echo $this->lang->line('search_part_description');?>:</label>
					<input id="search_part_description" type="text" name="search_part_description" value="" maxlength="100" size="20" /></span></td>
				</tr>
			</table>
			
			<input name="commit" type="submit" value="Search" /></td>
			</form>

			</td>
		</tr>
	</table>
	</div>

<hr />
	<div class="row">
		<h2 id="edit">Part List</h2>

			<table class="rfq-list">
				<thead>
					<tr>
						<th nowrap width="1%">#</th>
						<th nowrap width="24%">Name</th>
						<th nowrap width="29%">Vendor</th>
						<th nowrap width="6%">Phone</th>
						<th nowrap width="38%">Email</th>
						<th nowrap width="2%"></th>
					</tr>
				</thead>
				<tbody>
				<?php
				if (isset($total_rows) && $total_rows == 0):
				?>
    					<tr>
      						<td colspan="5">
							<?php echo $this->lang->line('invoice_no_invoice_match');?>
      						</td>
    					</tr>
				<?php
				else: 
					foreach($query->result() as $row): ?>
					
					<tr>
						<td>

							<?php echo anchor('part/show/'.$row->id, $row->id);?>
						</td>
						<td>
							<?php echo anchor('part/show/'.$row->id, $row->part_number);?>
						</td>
						<td>
							<?=$row->description;?>
						</td>
						<td>
							<?=$row->value;?>
						</td>
						<td>
							<?=$row->comment;?>
						</td>
						<td>
							
						</td>
					</tr>
				<?php 
					endforeach;
					endif; ?>
				</tbody>
			</table>

		
	</div>
</form>
<script>
	var tabs = new Control.Tabs('tabs',{
		defaultTab: 'last'
	})
	tabs.setActiveTab('one');
</script>

</div>
<!-- [Content End -->




